import java.io.*;

public class T6_4 {
    public static void main(String[] args) throws IOException {
        long start = System.currentTimeMillis();
       // method1("D:\\copy.mp4", "copy1.mp4");
        //method2("D:\\copy.mp4", "copy1.mp4");
       // method3("D:\\copy.mp4", "copy1.mp4");
        //method4("D:\\copy.mp4", "copy1.mp4");
        long end = System.currentTimeMillis();
        System.out.println("总共耗时" + (end - start) + "毫秒");

    }

    private static void method3(String srcString, String deststring) throws IOException {
            BufferedInputStream bos=new BufferedInputStream(new FileInputStream("copy1.mp4"));
            BufferedOutputStream bis=new BufferedOutputStream(new FileOutputStream("C:\\copy1.mp4"));
            byte[]bys=new byte[1024];
            int len=0;
            while ((len=bos.read( ))!=-1){
                System.out.println(new String(bys,0,len));
            }
            bos.close();
            bis.close();

        }


    private static void method2(String srcString, String deststring) throws IOException {
        FileInputStream fis=new FileInputStream("C:\\copy1.mp4");
        FileOutputStream fos=new FileOutputStream("copy1.mp4");
        byte[] bys=new byte[1024];
        int len=0;
        while ((len=fis.read(bys))!=-1){
            fos.write(bys,0,len);
        }
        fis.close();
        fos.close();
    }
    private static void method1(String srcString, String deststring) throws IOException {
        FileInputStream fis=new FileInputStream("C:\\copy1.mp4");
        FileOutputStream fos=new FileOutputStream("copy1.mp4");
        byte[] bys=new byte[1024];
        int len=0;
        while ((len=fis.read())!=-1){
            fos.write(bys,0,len);
        }
        fis.close();
        fos.close();

        }


    public static void method4(String srcString, String deststring) throws IOException {
        BufferedInputStream bos=new BufferedInputStream(new FileInputStream("copy1.mp4"));
        BufferedOutputStream bis=new BufferedOutputStream(new FileOutputStream("C:\\copy1.mp4"));
        byte[]bys=new byte[1024];
        int len=0;
        while ((len=bos.read(bys))!=-1){
            System.out.println(new String(bys,0,len));
        }
        bos.close();
        bis.close();

    }
    }



